import fetch from 'common/src/utils/fetch';
import UTILS from "common/src/utils/utils";
/*
*分页学籍管理查询强化班学生信息
*/
export function getScStuStatusInfoList(template) {
  return fetch({
    url: '/api/cultureservice/ScAdmStuRel/getScStuStatusInfoList',
    method: 'post',
    data: template
  })
}

/*
* 学籍退出（针对专业停招中途退班学生）
*/
export function exitStrengthClassStatus(template) {
  return fetch({
    url: '/api/cultureservice/ScAdmStuRel/exitStrengthClassStatus',
    method: 'post',
    data: template
  })
}

/*
* 学籍全部转出
*/
export function allExitStrengthClass(template) {
  return fetch({
    url: '/api/cultureservice/ScAdmStuRel/allExitStrengthClass',
    method: 'post',
    data:template
  })
}
/**
 * 学籍管理导出信息
 * @param {Object} params
 */
export function exportExcelScStudentInfoInStaManage(params) {
  const url = '/api/cultureservice/ScAdmStuRel/exportExcelScStudentInfoInStaManage';
  let queryParam = ''
  for (const key in params) {
    // 去掉空参数
    if (
      key === 'pageNum_' ||
      key === 'pageSize_' ||
      key === 'total_' ||
      params[key] === ''
    ) {
      continue
    }
    queryParam += `${key}=${params[key]}&`
  }
  window.open(`${url}?${queryParam}`)
}

/**
 * 成绩管理导出信息
 * @param {Object} params
 */
export function exportScStudentScoreExcel(params) {
  const url = '/api/cultureservice/ScAdmStuRel/exportScStudentScoreExcel';
  let queryParam = ''
  for (const key in params) {
    // 去掉空参数
    if (
      key === 'pageNum_' ||
      key === 'pageSize_' ||
      key === 'total_' ||
      params[key] === ''
    ) {
      continue
    }
    queryParam += `${key}=${params[key]}&`
  }
  window.open(`${url}?${queryParam}`)
}


/*
*分页成绩管理查询强化班学生信息
*/
export function getScStuStatusScoreList(template) {
  return fetch({
    url: '/api/cultureservice/ScAdmStuRel/getScStuStatusScoreList',
    method: 'post',
    data: template
  })
}

/**
 * 查询强化班成绩详情
 */
export function selectScoreData(data) { 
  return fetch({
      url: '/api/cultureservice/ScAdmStuRel/selectScoreData',
      method: 'post',
      data
  });
}


  /**
   * 打印签收单
   */
  export function exportExcelScStudentInfoInPdf(data) { 
    return fetch({
      url: '/api/cultureservice/ScAdmStuRel/exportExcelScStudentInfoInPdf',
      method: 'post',
      data:data,
      responseType: 'blob'
    }).then(res => {
      UTILS.downloadFile(res, '语言强化班-签收单.pdf', 'application/msword;charset=utf-8');
    });
  } 



















